package com.atguigu.lease.common.utils;

import java.util.Random;

public class VerifyCodeUtil {
    /**
     * 生成随机验证码
     * @param length 验证码长度
     * @return 验证码
     */
    public static String getVerifyCode(int length){
        Random random =new Random();
        StringBuilder stringBuilder =new StringBuilder();
        for (int i = 0; i < length; i++){
            stringBuilder.append(random.nextInt(10));
        }
        return stringBuilder.toString();
    }
}